package com.zeta.system.model.param;

import com.zeta.system.model.enums.MenuTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;

/**
 * 新增 菜单
 *
 * @author AutoGenerator
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Schema(description = "新增菜单")
public class SysMenuSaveDTO implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /** 名称 */
    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "菜单名称不能为空")
    @Size(max = 32, message = "菜单名称长度不能超过32")
    private String label;

    /** 父级id */
    @Schema(description = "父级id", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "父级id不能为空")
    private Long parentId;

    /** 排序 */
    @Schema(description = "排序", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Integer sortValue;

    /** 路由名称 */
    @Schema(description = "路由名称 type=MENU时不能为空", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String name;

    /** 路由地址 */
    @Schema(description = "路由地址 type=MENU时不能为空", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String path;

    /** 组件地址 */
    @Schema(description = "组件地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String component;

    /** 重定向地址 */
    @Schema(description = "重定向地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String redirect;

    /** 图标 */
    @Schema(description = "图标", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String icon;

    /** 权限标识 */
    @Schema(description = "权限标识", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String authority;

    /** 菜单类型 */
    @Schema(description = "菜单类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "菜单类型不能为空")
    private MenuTypeEnum type;

    /** 是否隐藏 0否 1是 */
    @Schema(description = "是否隐藏 0否 1是", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Boolean hide;

    /** 是否缓存 0否 1是 */
    @Schema(description = "是否缓存 0否 1是", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private Boolean keepAlive;

    /** 外链地址 */
    @Schema(description = "外链地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String href;

    /** 内链地址 */
    @Schema(description = "内链地址", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    private String frameSrc;

}
